package vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.policies;

import java.util.Iterator;

import org.eclipse.emf.ecore.EAnnotation;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.core.commands.DeleteCommand;
import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientReferenceRelationshipRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
import org.eclipse.gmf.runtime.notation.Edge;
import org.eclipse.gmf.runtime.notation.View;

import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.CommandDestinationsCreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.CommandDestinationsReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UIContainerRelationshipCreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UIContainerRelationshipReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship10CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship10ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship11CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship11ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship2CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship2ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship3CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship3ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship4CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship4ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship5CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship5ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship6CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship6ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship7CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship7ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship8CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship8ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship9CreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationship9ReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationshipCreateCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.commands.UITemporalRelationshipReorientCommand;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.CommandDestinationsEditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UIContainerRelationshipEditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship10EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship11EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship2EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship3EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship4EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship5EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship6EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship7EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship8EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationship9EditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.edit.parts.UITemporalRelationshipEditPart;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.part.AdaptedauiVisualIDRegistry;
import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.providers.AdaptedauiElementTypes;

/**
 * @generated
 */
public class ActivatorItemSemanticEditPolicy extends
		AdaptedauiBaseItemSemanticEditPolicy {

	/**
	 * @generated
	 */
	public ActivatorItemSemanticEditPolicy() {
		super(AdaptedauiElementTypes.Activator_3007);
	}

	/**
	 * @generated
	 */
	protected Command getDestroyElementCommand(DestroyElementRequest req) {
		View view = (View) getHost().getModel();
		CompositeTransactionalCommand cmd = new CompositeTransactionalCommand(
				getEditingDomain(), null);
		cmd.setTransactionNestingEnabled(false);
		for (Iterator<?> it = view.getTargetEdges().iterator(); it.hasNext();) {
			Edge incomingLink = (Edge) it.next();
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationshipEditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship2EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship3EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship4EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship5EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship6EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship7EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship8EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship9EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship10EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UITemporalRelationship11EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(incomingLink) == UIContainerRelationshipEditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						incomingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
				continue;
			}
		}
		for (Iterator<?> it = view.getSourceEdges().iterator(); it.hasNext();) {
			Edge outgoingLink = (Edge) it.next();
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationshipEditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship2EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship3EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship4EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship5EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship6EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship7EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship8EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship9EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship10EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == UITemporalRelationship11EditPart.VISUAL_ID) {
				DestroyElementRequest r = new DestroyElementRequest(
						outgoingLink.getElement(), false);
				cmd.add(new DestroyElementCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
			if (AdaptedauiVisualIDRegistry.getVisualID(outgoingLink) == CommandDestinationsEditPart.VISUAL_ID) {
				DestroyReferenceRequest r = new DestroyReferenceRequest(
						outgoingLink.getSource().getElement(), null,
						outgoingLink.getTarget().getElement(), false);
				cmd.add(new DestroyReferenceCommand(r));
				cmd.add(new DeleteCommand(getEditingDomain(), outgoingLink));
				continue;
			}
		}
		EAnnotation annotation = view.getEAnnotation("Shortcut"); //$NON-NLS-1$
		if (annotation == null) {
			// there are indirectly referenced children, need extra commands: false
			addDestroyShortcutsCommand(cmd, view);
			// delete host element
			cmd.add(new DestroyElementCommand(req));
		} else {
			cmd.add(new DeleteCommand(getEditingDomain(), view));
		}
		return getGEFWrapper(cmd.reduce());
	}

	/**
	 * @generated
	 */
	protected Command getCreateRelationshipCommand(CreateRelationshipRequest req) {
		Command command = req.getTarget() == null ? getStartCreateRelationshipCommand(req)
				: getCompleteCreateRelationshipCommand(req);
		return command != null ? command : super
				.getCreateRelationshipCommand(req);
	}

	/**
	 * @generated
	 */
	protected Command getStartCreateRelationshipCommand(
			CreateRelationshipRequest req) {
		if (AdaptedauiElementTypes.UITemporalRelationship_4001 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationshipCreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4002 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship2CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4003 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship3CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4004 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship4CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4005 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship5CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4006 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship6CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4007 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship7CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4008 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship8CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4009 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship9CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4010 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship10CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4011 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship11CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UIContainerRelationship_4012 == req
				.getElementType()) {
			return null;
		}
		if (AdaptedauiElementTypes.CommandDestinations_4014 == req
				.getElementType()) {
			return getGEFWrapper(new CommandDestinationsCreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		return null;
	}

	/**
	 * @generated
	 */
	protected Command getCompleteCreateRelationshipCommand(
			CreateRelationshipRequest req) {
		if (AdaptedauiElementTypes.UITemporalRelationship_4001 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationshipCreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4002 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship2CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4003 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship3CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4004 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship4CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4005 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship5CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4006 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship6CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4007 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship7CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4008 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship8CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4009 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship9CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4010 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship10CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UITemporalRelationship_4011 == req
				.getElementType()) {
			return getGEFWrapper(new UITemporalRelationship11CreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.UIContainerRelationship_4012 == req
				.getElementType()) {
			return getGEFWrapper(new UIContainerRelationshipCreateCommand(req,
					req.getSource(), req.getTarget()));
		}
		if (AdaptedauiElementTypes.CommandDestinations_4014 == req
				.getElementType()) {
			return null;
		}
		return null;
	}

	/**
	 * Returns command to reorient EClass based link. New link target or source
	 * should be the domain model element associated with this node.
	 * 
	 * @generated
	 */
	protected Command getReorientRelationshipCommand(
			ReorientRelationshipRequest req) {
		switch (getVisualID(req)) {
		case UITemporalRelationshipEditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationshipReorientCommand(req));
		case UITemporalRelationship2EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship2ReorientCommand(req));
		case UITemporalRelationship3EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship3ReorientCommand(req));
		case UITemporalRelationship4EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship4ReorientCommand(req));
		case UITemporalRelationship5EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship5ReorientCommand(req));
		case UITemporalRelationship6EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship6ReorientCommand(req));
		case UITemporalRelationship7EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship7ReorientCommand(req));
		case UITemporalRelationship8EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship8ReorientCommand(req));
		case UITemporalRelationship9EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship9ReorientCommand(req));
		case UITemporalRelationship10EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship10ReorientCommand(
					req));
		case UITemporalRelationship11EditPart.VISUAL_ID:
			return getGEFWrapper(new UITemporalRelationship11ReorientCommand(
					req));
		case UIContainerRelationshipEditPart.VISUAL_ID:
			return getGEFWrapper(new UIContainerRelationshipReorientCommand(req));
		}
		return super.getReorientRelationshipCommand(req);
	}

	/**
	 * Returns command to reorient EReference based link. New link target or source
	 * should be the domain model element associated with this node.
	 * 
	 * @generated
	 */
	protected Command getReorientReferenceRelationshipCommand(
			ReorientReferenceRelationshipRequest req) {
		switch (getVisualID(req)) {
		case CommandDestinationsEditPart.VISUAL_ID:
			return getGEFWrapper(new CommandDestinationsReorientCommand(req));
		}
		return super.getReorientReferenceRelationshipCommand(req);
	}

}
